package stream;

import java.sql.Array;
import java.sql.SQLOutput;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author wang'ji'cheng
 * @date 2025/7/19
 */
public class Homework3 {

    public static void main(String[] args) {
        ArrayList<String> man = new ArrayList<>();
        ArrayList<String> woman = new ArrayList<>();
        Collections.addAll(woman,"赵丽颖，30","杨英，25","高圆圆，35","张甜甜，35","杨小米，33","刘娜，25");
        Collections.addAll(man,"蔡徐坤，20","张艺兴，25","吴亦凡，35","马嘉祺，20","王俊凯，24","易烊千玺，25");
        Stream<String> manStream = man.stream().filter(s -> s.split("，")[0].length() == 3).limit(2);
        Stream<String>womanStream = woman.stream().filter(s -> s.split("，")[0].startsWith("杨")).skip(1);

        List<String> collect = Stream.concat(manStream, womanStream).collect(Collectors.toList());
        System.out.println(collect);

    }

}
